package com.crp.broker.rabbitmq.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

/**
 * 功能概要：消费接收
 *  
 */
public class MessageConsumer implements MessageListener {
    
    private Logger logger = LoggerFactory.getLogger(MessageConsumer.class);

    @Override
    public void onMessage(Message message) {
        try {
            logger.info("thead--->begin");
            Thread.sleep(3000l);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        logger.info("receive message:{}",message);
        logger.info("cityname------>"+new String(message.getBody()));
    }

}
